<?php
namespace Home\Controller;
use Think\Controller;
  class BaseController extends  Controller{
  	function _initialize(){
	 $Auth = new \Think\Auth();
      $name = MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME;
  if($_SESSION["username"]){
    	$username=$_SESSION["username"];
    	 $m=M("member");
	 $res=$m->where("username='{$username}'")->select();
	  $id=$res[0]["id"];
  $uid=$id;
  if (!$Auth->check($name, $uid)) {
// die('认证：成功');
	$this->assign("code","403");
	$this->assign("message","请使用更高的权限账号登录");
	$this->assign("url","/");
	$this->display("404");
   die('');
  }
}
}
  }
?>